package com.maxh.service.impl;

import com.maxh.mapper.UserMapper;
import com.maxh.pojo.User;
import com.maxh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("UserService")
public class UserServiceImpl implements UserService {
    @Autowired(required =  false)
    UserMapper userMapper;

    /*查找用户名*/
    public User findByUsername(String username){
        return userMapper.findByUsername(username);
    }
    /*查找用户名*/
    public User findByUserNum(String userNum){
        return userMapper.findByUserNum(userNum);
    }
    /*查找用户Id*/
    public User findUserById(String userId) {
        return userMapper.findUserById(userId);
    }

    //获取用户信息
    public Object userList(){return userMapper.userList();}

    /*添加用户*/
    public boolean addUser(Map<String, Object> map){return userMapper.addUser(map);}

    //更新用户信息
    public boolean updateUser(Map<String, Object> map){return userMapper.updateUser(map);}

    /*删除用户信息*/
    public boolean deleteUser(String map){return userMapper.deleteUser(map);}

    public List<Map<String,Object>> searchUser(Map<String, Object> map) {
        return userMapper.searchUser(map);
    }

}
